<ion-content no-padding class="sugesstion">
  <top-tab [data]="items"></top-tab>
 <div *ngIf="currentPageIndex == 0" class="complaint">
   <ion-grid class="select-box">
     <ion-row>
       <ion-col col-3>投诉类型</ion-col>
       <ion-col>
         <ion-select placeholder="请选择投诉类型(*必选项)" class="select" [(ngModel)]="data.category">
           <ion-option *ngFor="let item of complaintCategory" [value]="item.code">{{item.name}}</ion-option>
         </ion-select>
       </ion-col>
     </ion-row>
   </ion-grid>
   <ion-grid class="textarea-warp">
     <textarea placeholder="说一说具体投诉或者建议内容(*必填项)" [(ngModel)]="data.content"></textarea>
   </ion-grid>
   <ion-grid class="btn-box">
     <button (click)="sumbitComplaint(data)" [disabled]="data.category==''|| data.content=='' ">立即投诉</button>
   </ion-grid>
 </div>
  <ion-refresher (ionRefresh)="doRefresh($event)">
    <ion-refresher-content></ion-refresher-content>
  </ion-refresher>
  <div class="complaint-detail" *ngIf="currentPageIndex == 1">
    <div class="com-item" *ngFor="let item of complaintDetailList">
      <ion-grid class="title">
        <ion-row>
          <ion-col>{{item.categoryName}}</ion-col>
          <ion-col [ngStyle]="statusStyle(item)">{{item.statusName}}</ion-col>
        </ion-row>
      </ion-grid>
      <ion-grid class="content">
        <ion-row>
          <ion-col>投诉时间：{{item.createTime}}</ion-col>
        </ion-row>
        <ion-row *ngIf="item.dealTime!=null">
          <ion-col>处理时间：{{item.dealTime}}</ion-col>
        </ion-row>
        <ion-row>
          <ion-col class="con">{{item.content}}</ion-col>
        </ion-row>
      </ion-grid>
    </div>
    <div class="notice" *ngIf="complaintDetailList.length<=0">
      ----暂无投诉建议----
    </div>
    <ion-infinite-scroll (ionInfinite)="doInfinite($event)" *ngIf="canLoadMore">
      <ion-infinite-scroll-content></ion-infinite-scroll-content>
    </ion-infinite-scroll>
    <div *ngIf="!canLoadMore&&complaintDetailList.length>10"
         style="text-align: center;width: 100%;height: 60px;padding: 20px 0;color: #848484;">
      ————————别扯啦!————————
    </div>
  </div>
</ion-content>
